home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / arexx-scripts / adpro-arexx / mitimg.lha / ripple.IM.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1993-07-07  |  2.2 KB  |  98 lines

  1. /* 
  2. ** This ARexx program performs a radial wave animation on an image.
  3. ** Source is any IFF file.  Destination is <length> iff files of the form
  4. ** <dest>.xxx.  Destination file size is currently set to 256x200 and the
  5. ** imagepath is set to "work:".
  6. */
  7.  
  8. PARSE ARG source dest start length
  9.  
  10. say 'START'
  11. say source dest start length
  12.  
  13.  
  14. /*
  15.  * open rexxsupport.library -- needed for some functions
  16.  */
  17. if ~show('L',"rexxsupport.library") then do
  18.   if addlib('rexxsupport.library',0,-30,0) then do
  19.       /* everything's ok */
  20.     end;
  21.   else do
  22.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  23.     say 'Cannot operate wipe.rexx without this library - sorry!';
  24.     exit 10;
  25.     end;
  26.   end;
  27.  
  28. /*
  29.  * This will automatically direct the script to the proper
  30.  * software, if it is running.
  31.  */
  32. prtnme = 'IP_Port'; /* assume Image Professional */
  33. if show('P','IP_Port') = 0 then do
  34.   if show('P','IM_Port') = 0 then do
  35.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  36.     say "This script requires IP, IM or IM F/c to run!";
  37.     exit(20);
  38.     end;
  39.   else do
  40.     prtnme = 'IM_Port'; /* That's the thing about assumptions... */
  41.     end;                 /* We make em, user's break em.          */
  42.   end;
  43.  
  44. options results;
  45. address;
  46.  
  47.   address(prtnme);
  48.  
  49.  
  50. imagepath "work:"
  51. width=350
  52. height=450
  53. xrad=20
  54. yrad=20
  55. wavelength=40
  56. mag=40
  57. phase=0
  58.  
  59. frame=start
  60. /* Comment out load to use image in ImageMaster buffer 0.     */
  61. /* Must be only buffer open in ImageMaster to work correctly. */
  62. load source
  63. do length
  64.      frame=RIGHT(frame,3,'0')
  65.     Say 'Working on Frame #'frame
  66.     newcurrent 0
  67.     entire
  68.     clip ripple
  69.     Say 'Showing new buffer'
  70.     newcurrent 2
  71.  
  72. /* Change following line for different origin and size of ripple. */
  73.     oval 175 225 xrad yrad
  74.     Say 'Performing wave operation'
  75.     ripple wavelength mag phase
  76.     entire
  77.  
  78.     SAY 'Saving  Frame #'frame
  79.     framestr=dest||frame'.iff'
  80. /* Change stretch parameters to change size of destination. */
  81.     stretch 256 200 framestr
  82.     SAVE 3
  83.     killbuff 3
  84.     killbuff 2
  85. /* To make the destination the same size as the original, replace  */
  86. /* preceding lines with:                       */
  87. /*    SAVE 2                               */
  88. /*    killbuff 2                           */
  89.  
  90.     frame=frame+1
  91.     xrad=xrad+15
  92.     yrad=yrad+20
  93.     mag=mag-1
  94.     phase=phase+20
  95.     
  96. end
  97. newcurrent 0
  98.